package com.lhk.appframework.utils.json;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

public class UtilsJson {
	
	
	@SuppressWarnings("unchecked")
	public static Object json2Object(String json, Class type){
		Gson gson = new Gson();
		return gson.fromJson(json, type);
		
	}
	
	
	public static String object2Json(Object object){
		Gson gson = new GsonBuilder().serializeNulls().create();
		String json = gson.toJson(object);
		return json;
	}
	
}
